<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableTopic extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('topics', function (Blueprint $table) {
            $table->increments('tid');  //更改主键为tid
            $table->integer('uid')->unsigned()->default(0);  //用户ID
            $table->string('title')->default(''); //话题
            $table->text('desc')->default('');  //描述
            $table->boolean('comment')->default(1);  //是否允许评论
            $table->tinyInteger('pwd')->unsigned()->default(0);  //投票密码
            $table->tinyInteger('limit')->unsigned()->default(0);  //票数上线
            $table->boolean('show_result')->default(0);  //投票完成显示结果
            $table->integer('put_time')->unsigned()->default(0);  //发布时间
            $table->integer('exp_time')->unsigned()->default(0);  //过期时间
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('topics');
    }
}
